Carbon


MPWaitForEvent

Header: Multiprocessing.h Carbon status: Supported

Retrieves event flags from a specified event group.

OSStatus MPWaitForEvent (
    MPEventID event, 
    MPEventFlags *flags, 
    Duration timeout
);
event

The event group whose flags you want to retrieve.

flags

On return, flags contains the flags of the specified event group. Pass NULL if you do not need any flag information.

timeout

The maximum time to wait for events before timing out. See “Timer Duration Constants” for a list of constants you can use to specify the wait interval.

function result

A result code.

DISCUSSION

This function obtains event flags from the specified event group. The timeout specifies how long to wait for events if none are present when the call is made. If any flags are set when this function is called, all the flags in the event group are moved to the flag field and the event group is cleared. This obtaining and clearing action is an atomic operation to ensure that no updates are lost. If multiple tasks are waiting on an event group, only one can obtain any particular set of flags.

If you call this function from a cooperative task, you should specify only kDurationImmediate for the timeout length; other waits will cause the task to block.

Also see the function MPSetEvent.

VERSION NOTES

Introduced with Multiprocessing Services 2.0.

AVAILABILITY

Supported in Carbon. Available in CarbonLib 1.0 and later when MPLibrary 2.0 or later is installed. Exported by CarbonLib 1.0 and later and by MPLibrary 2.0 and later.


© 2000 Apple Computer, Inc. — (Last Updated 4/6/2000)